﻿@model Project_2._2.ViewModels.BookCarsViewModel
@{
    ViewBag.Title = "Đặt Xe";
    Layout = "~/Views/Shared/_UserLayoutPage2.cshtml";
    Project_2._2.Models.QuanLyThueXeEntities db = new Project_2._2.Models.QuanLyThueXeEntities();
}

<script src="~/Script/Validate/jquery.validate.min.js"></script>
<script src="~/Script/Validate/jquery.validate.unobtrusive.min.js"></script>
<script src="~/Script/Validate/jquery.validate.min.js"></script>
<script src="~/Script/Validate/jquery.validate.unobtrusive.min.js"></script>
<link href="~/Content/Validate%20Javascript/validationEngine.jquery.css" rel="stylesheet" />
<script src="~/Script/Validate%20Javascript/jquery-1.8.2.min.js"></script>
<script src="~/Script/Validate%20Javascript/jquery.validationEngine.js"></script>
<script src="~/Script/Validate%20Javascript/jquery.validationEngine-vi.js"></script>

<script>
    jQuery(document).ready(function () {
        // binds form submission and fields to the validation engine
        jQuery("#form").validationEngine();
    });

</script>
<style type="text/css">
    .mail_lienhe {
        color: #676767;
    }

        .mail_lienhe:hover {
            color: #ff0000;
        }
</style>

<div style="width:748px; min-height:500px; height:auto; border:2px solid #cfcfcf; border-radius:5px; margin-top:10px">
    <div style="height:54px; width:748px; background:url('../Images/UserDesign/bg_right.png') repeat-x; border-bottom:2px solid #cfcfcf;">
        <div style="width:105px; height:54px; float:left; margin-left:5px;">
            <img src="../Images/UserDesign/car.png" />
        </div>
        <div style="width:638px; height:54px; float:right">
            <span style="font-weight:bold; color:#ffffff; font-family:Tahoma; font-size:14px; line-height:38px" >THÔNG TIN ĐẶT XE</span>
        </div>
    </div>

    <!--Form liên hệ-->
    <div style="min-height:300px; height:auto; width:740px; margin-left:8px">
        @using (Html.BeginForm("DatXe", "Default", FormMethod.Post, new { id = "form" }))
        {
            @Html.ValidationSummary(true)   <!--Hiển thị kiểm lỗi phía server-->
            @Html.AntiForgeryToken()        <!--Chống giả lập yêu cầu-->

            <table style="padding:0px 0 0 34px ; line-height:35px">
                <tr>
                    <td style="padding-top:12px"> @Html.LabelFor(m => m.DichVuId)<span style="color:red"></span></td>
                    <td style="padding-top:12px">
                        @{

                            List<SelectListItem> ListServiec = new List<SelectListItem>();
                            var Listdv = from p in db.DichVuThueXes select p;
                            foreach (var item in Listdv)
                            {
                                ListServiec.Add(new SelectListItem { Text = item.TenDichVu, Value = Convert.ToString(item.DichVuId) });
                            }
                          }
                        @Html.DropDownListFor(m => m.DichVuId, ListServiec, new { @class = "select", @style = "width:200px" })

                    </td>
                </tr>

                <tr >
                    <td style="padding-top:12px">@Html.LabelFor(m => m.XeId)<span style="color:red"></span></td>
                    <td style="padding-top:12px">
                        @{
                            List<SelectListItem> ListCars = new List<SelectListItem>();
                            var car = from p in db.Xes select p;
                            foreach (var item in car)
                            {
                                ListCars.Add(new SelectListItem { Text = item.TenXe, Value = Convert.ToString(item.XeId) });
                            }
                        }
                        @Html.DropDownListFor(m => m.XeId, ListCars, new { @class = "select", @style = "width:200px" })
                    </td>

                </tr>
                <tr>
                    <td style="padding-top:12px">@Html.LabelFor(m => m.HoTen)<span style="color:red"> * </span></td>
                    <td style="padding-top:12px">
                        @Html.TextBoxFor(m => m.HoTen, new { @class = "Textbox validate[required,maxSize[200]]", @style = "width:300px" })
                        @Html.ValidationMessageFor(m => m.HoTen)
                    </td>
                </tr>

                <tr>
                    <td style="padding-top:12px">@Html.LabelFor(m => m.DienThoai)<span style="color:red"> * </span></td>
                    <td style="padding-top:12px">
                        @Html.TextBoxFor(m => m.DienThoai, new { @class = "Textbox validate[required,custom[phone]]", @style = "width:300px" })
                        @Html.ValidationMessageFor(m => m.DienThoai)
                    </td>
                </tr>

                <tr>
                    <td style="padding-top:12px">@Html.LabelFor(m => m.Email)<span style="color:red">  *  </span></td>
                    <td style="padding-top:12px">
                        @Html.TextBoxFor(m => m.Email, new { @class = "Textbox validate[required,custom[email],maxSize[100]]", @style = "width:350px" })
                        @Html.ValidationMessageFor(m => m.Email)
                    </td>
                </tr>
                <tr>
                    <td style="padding-top:12px">@Html.LabelFor(m => m.DiaChi)<span style="color:red">  *  </span></td>
                    <td style="padding-top:12px">
                        @Html.TextAreaFor(m => m.DiaChi, new { @class = "TextArea validate[required,maxSize[500]]", @style = "width:400px; height:50px" })
                        @Html.ValidationMessageFor(m => m.DiaChi)
                    </td>
                </tr>
                <tr>
                    <td style="padding-top:12px">@Html.LabelFor(m => m.YeuCau)<span style="color:red"></span></td>
                    <td style="padding-top:12px">
                        @Html.TextAreaFor(m => m.YeuCau, new { @class = "TextArea ", @style = "width:400px; height:96px" })
                        @Html.ValidationMessageFor(m => m.YeuCau)
                    </td>
                </tr>

                <tr>
                    <td class="align-right" style="padding-top:12px">@Html.LabelFor(m => m.captcha) <span style="color:red">  *  </span></td>
                    <td style="padding-top:12px">
                        @Html.TextBoxFor(m => m.captcha, new { @class = "Textbox validate[required]", @style = "width:80px" })
                        <img id="Img3" alt="Captcha image" src="../Captcha/Captcha" style=" margin-bottom:-10px; height:29px;border-radius:4px; " />
                        @Html.ValidationMessageFor(m => m.captcha)
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align:center" style="padding-top:12px">
                        <input type="submit" class="Button" value=" Gửi " />
                        <input type="reset" class="Button" value="Hủy" />
                    </td>
                </tr>

                <tr>
                    <td></td>
                    <td>
                        @if (!string.IsNullOrEmpty(ViewBag.SucessMessage))
                        {
                            <div style="color:red; font-weight:bold; font-size:14px">@ViewBag.SucessMessage</div>
                        }
                    </td>
                </tr>

            </table><br />
        }

    </div>
</div>

